package bairui.international.model.domain.jpa;

/**
 *
 * @see TB_ElectronicTicketPresentRecord 电子券赠送记录
 *
 */
public class TestData_TB_ElectronicTicketPresentRecord
{

	private final static org.apache.commons.text.RandomStringGenerator Generator = new org.apache.commons.text.RandomStringGenerator.Builder().withinRange(new char[][]{{'a','z'}, {'A','Z'}, {'0','9'}}).build();

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_ElectronicTicketPresentRecord saveMust(
		org.springframework.context.ApplicationContext context,
		bairui.international.model.domain.jpa.TB_ElectronicTicket electronicTicket
	,bairui.international.model.domain.jpa.TB_User presenteder
	,bairui.international.model.domain.jpa.TB_User presenter
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_ElectronicTicketPresentRecord");
		return (TB_ElectronicTicketPresentRecord)repository.save(newMust(
				electronicTicket
				,presenteder
				,presenter
			));
	}
	
	public static TB_ElectronicTicketPresentRecord newMust(
		bairui.international.model.domain.jpa.TB_ElectronicTicket electronicTicket
	,bairui.international.model.domain.jpa.TB_User presenteder
	,bairui.international.model.domain.jpa.TB_User presenter
	){
		return new TB_ElectronicTicketPresentRecord(new TB_ElectronicTicketPresentRecord.MustProperties() {
			/** 电子券 */
			@Override public bairui.international.model.domain.jpa.TB_ElectronicTicket getElectronicTicket(){
				return electronicTicket;
			}
			/** 接受赠送者 */
			@Override public bairui.international.model.domain.jpa.TB_User getPresenteder(){
				return presenteder;
			}
			/** 赠送者 */
			@Override public bairui.international.model.domain.jpa.TB_User getPresenter(){
				return presenter;
			}
			/** 卡号 */
			@Override public String getNumber(){
				return Generator.generate(0, 32);
			}
			/** 转送次数 */
			@Override public Integer getTransmitCount(){
				return com.sh_lianjing.test.random.Util_GenerateRandom.intRandom(1, Integer.MAX_VALUE);
			}
		});
	}
	

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_ElectronicTicketPresentRecord saveAll(
		org.springframework.context.ApplicationContext context,
		bairui.international.model.domain.jpa.TB_ElectronicTicket electronicTicket
	,bairui.international.model.domain.jpa.TB_User presenteder
	,bairui.international.model.domain.jpa.TB_User presenter
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_ElectronicTicketPresentRecord");
		return (TB_ElectronicTicketPresentRecord)repository.save(newAll(
				electronicTicket
				,presenteder
				,presenter
			));
	}
	
	public static TB_ElectronicTicketPresentRecord newAll(
		bairui.international.model.domain.jpa.TB_ElectronicTicket electronicTicket
	,bairui.international.model.domain.jpa.TB_User presenteder
	,bairui.international.model.domain.jpa.TB_User presenter
	){
		return new TB_ElectronicTicketPresentRecord(
			new TB_ElectronicTicketPresentRecord.MustProperties() {
				/** 电子券 */
				@Override public bairui.international.model.domain.jpa.TB_ElectronicTicket getElectronicTicket(){
					return electronicTicket;
				}
				/** 接受赠送者 */
				@Override public bairui.international.model.domain.jpa.TB_User getPresenteder(){
					return presenteder;
				}
				/** 赠送者 */
				@Override public bairui.international.model.domain.jpa.TB_User getPresenter(){
					return presenter;
				}
				/** 卡号 */
				@Override public String getNumber(){
					return Generator.generate(0, 32);
				}
				/** 转送次数 */
				@Override public Integer getTransmitCount(){
					return com.sh_lianjing.test.random.Util_GenerateRandom.intRandom(1, Integer.MAX_VALUE);
				}
			},
			new TB_ElectronicTicketPresentRecord.OptionalSingleProperties() {
			}
		);
	}
	

}
